//
//  KHHTravelNotesDetailLocationPageCollectionViewCell.m
//  Travel
//
//  Created by dllo on 15/12/1.
//  Copyright © 2015年 doll. All rights reserved.
//

#import "KHHTravelNotesDetailLocationPageCollectionViewCell.h"
#import "UIImage+GIF.h"
#import "UIImageView+WebCache.h"

@interface KHHTravelNotesDetailLocationPageCollectionViewCell ()

@property (nonatomic, retain)UIImageView *img;

@end


@implementation KHHTravelNotesDetailLocationPageCollectionViewCell

//初始化
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.img = [[UIImageView alloc] init];
        self.img.contentMode = UIViewContentModeScaleAspectFill;
        self.img.clipsToBounds = YES;
        [self.contentView addSubview:self.img];
    }
    return self;
}

//布局
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.img.frame = self.contentView.frame;
}

//赋值
- (void)setModelWaypoints:(KHHRecommendModel *)modelWaypoints
{
    _modelWaypoints = modelWaypoints;
    
    [self.img sd_setImageWithURL:[NSURL URLWithString:modelWaypoints.photo] placeholderImage:[UIImage sd_animatedGIFNamed:@"load"]];
}

@end
